//Shirasu Azusa 2024.5
#include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x)  {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x)  {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x)  {return (x==0?-1:__builtin_ctzll(x));}

#define int long long
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;  
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
  int x=0,w=1; char c=getchar(); 
  while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
  while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();} 
  return x*w;
}

const int N=1005,inf=1e10,lim=1e5;
int n,m,q,s,t,e[N][N],w[N][N],c[N][N],h[N],f[N],p[N],d[N],ans[lim+5];

void dij() {
  static bool vst[N];
  rep(j,0,t) vst[j]=0, d[j]=inf; d[s]=0;
  rep(r,1,t) {
    int x=0; rep(i,1,t) if(!vst[i]&&d[i]<d[x]) x=i;
    if(!x) break; vst[x]=1;
    rep(y,1,t) if(c[x][y]&&e[x][y]<inf)
      if(chmin(d[y],d[x]+e[x][y]+h[x]-h[y])) p[y]=x;
  }
}
void work() {
  rep(k,1,n) {
    dij(); f[k]=f[k-1];
    if(d[t]>=inf) {
      rep(j,k,n) f[j]=inf;
      return;
    }
    rep(i,1,t) h[i]+=d[i];
    int x=t;
    while(x!=s) {
      f[k]+=e[p[x]][x];
      c[p[x]][x]--, c[x][p[x]]++;
      x=p[x];
    }
  }
}

int val(int x,int y) {
  if(f[x]==inf) return inf;
  else return f[x]+(n-x)*y;
}

signed main() {
  freopen("journey.in","r",stdin);
  freopen("journey.out","w",stdout);
  n=read(), m=read(), q=read();
  s=2*n+1, t=2*n+2;
  rep(i,1,t) rep(j,1,t) e[i][j]=w[i][j]=inf;
  rep(i,1,m) {
    int u=read(), v=read(), W=read();
    chmin(w[u][v],W);
  }
  rep(k,1,n) rep(i,1,n) rep(j,1,n) chmin(w[i][j],w[i][k]+w[k][j]);
  rep(i,1,n) rep(j,1,n) if(w[i][j]<inf) {
    e[i][j+n]=w[i][j], c[i][j+n]=1;
  }
  rep(i,1,n) e[s][i]=0, c[s][i]=1;
  rep(i,1,n) e[i+n][t]=0, c[i+n][t]=1;
  rep(i,1,n) rep(j,1,n) e[j+n][i]=-e[i][j+n];
  dij(); rep(i,1,t) h[i]=d[i]; work();
  int t=0;
  rep(i,1,lim) {
    while(t<n&&val(t,i)>=val(t+1,i)) ++t;
    ans[i]=val(t,i);
  }
  rep(i,1,q) {
    int c=read();
    printf("%lld\n",ans[c]);
  }
  return 0;
}